/**
 * @param {string} s
 * @param {number} minJump
 * @param {number} maxJump
 * @return {boolean}
 */
// dp[i] 
var canReach = function(s, minJump, maxJump) {
    if(s[s.length-1] !== '0')
        return false
    if(!s.includes('1'))
        return true
    const n = s.length
    const dp = new Array(n).fill(false)
    dp[0] = true
    const queue = [0]
    while(queue.length > 0){
        let idx = queue.shift()
        let l = idx+minJump, r = Math.min(idx+maxJump, n-1)
        if(l > n-1)
            break
        let x = []
        for(let i = l; i<=r; i++){
            if(s[i] === '0'){
                dp[i] = dp[idx]
                x.push(i)
            }
        }
        queue.push(Math.min(...x),Math.max(...x))
    }
    return dp[n-1]
};